package org.goldenmock.web.matchers;

import org.goldenmock.web.server.EasyHttpRequest;

/**
 * @author Robin Wagenaar
 * @author Arjen van Staalduinen
 */
public class RequestMethodMatcher extends EasyRequestMatcher {
    private final String expectedMethod;

    public RequestMethodMatcher(String expectedMethod) {
        this.expectedMethod = expectedMethod.toUpperCase();
    }

    @Override
    public boolean matchesEasyRequest(EasyHttpRequest easyHttpRequest) {
        return easyHttpRequest.getMethod().toUpperCase().equals(expectedMethod);
    }
}
